package com.lottery.common.startup;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.lottery.module.api.impl.LotterySaleProcesserImpl;
import com.lottery.thrift.ThriftService;

@Component
@Order(value = 1)
public class StartupRunner implements CommandLineRunner {

  @Value("${thrift.service.port}")
  private int thriftServicePort;

  @Override
  public void run(String... args) throws Exception {
    System.out.println("加载启动参数：" + args);
    ThriftService.start(LotterySaleProcesserImpl.class, thriftServicePort);
  }

}
